
### 2. Deploy to LangGraph Platform

<Steps>
<Step title="Navigate to LangSmith Deployments">
    Log in to [LangSmith](https://smith.langchain.com/). In the left sidebar, select **Deployments**.
</Step>
<Step title="Create new deployment">
    Click the **+ New Deployment** button. A pane will open where you can fill in the required fields.
</Step>
<Step title="Link repository">
    If you are a first time user or adding a private repository that has not been previously connected, click the **Add new account** button and follow the instructions to connect your GitHub account.
</Step>
<Step title="Deploy repository">
    Select your application's repository. Click **Submit** to deploy. This may take about 15 minutes to complete. You can check the status in the **Deployment details** view.
</Step>
</Steps>

### 3. Test your application in LangGraph Studio

Once your application is deployed:

1. Select the deployment you just created to view more details.
2. Click the **LangGraph Studio** button in the top right corner. LangGraph Studio will open to display your graph.

### 4. Get the API URL for your deployment

1. In the **Deployment details** view in LangGraph, click the **API URL** to copy it to your clipboard.
2. Click the `URL` to copy it to the clipboard.

### 5. Test the API

You can now test the API:

<Tabs>
:::python
<Tab title="Python">
1. Install LangGraph Python:
```shell
pip install langgraph-sdk
```
2. Send a message to the agent:
```python
from langgraph_sdk import get_sync_client # or get_client for async

client = get_sync_client(url="your-deployment-url", api_key="your-langsmith-api-key")

for chunk in client.runs.stream(
    None,    # Threadless run
    "agent", # Name of agent. Defined in langgraph.json.
    input={
        "messages": [{
            "role": "human",
            "content": "What is LangGraph?",
        }],
    },
    stream_mode="updates",
):
    print(f"Receiving new event of type: {chunk.event}...")
    print(chunk.data)
    print("\n\n")
```
</Tab>
:::
:::js
<Tab title="JavaScript">
1. Install LangGraph JS:
```shell
npm install @langchain/langgraph-sdk
```
2. Send a message to the agent:
```ts
const { Client } = await import("@langchain/langgraph-sdk");

const client = new Client({ apiUrl: "your-deployment-url", apiKey: "your-langsmith-api-key" });

const streamResponse = client.runs.stream(
    null,    // Threadless run
    "agent", // Name of agent. Defined in langgraph.json.
    {
        input: {
            "messages": [
                { "role": "user", "content": "What is LangGraph?"}
            ]
        },
        streamMode: "messages",
    }
);

for await (const chunk of streamResponse) {
    console.log(`Receiving new event of type: ${chunk.event}...`);
    console.log(JSON.stringify(chunk.data));
    console.log("\n\n");
}
```
</Tab>
:::
<Tab title="Rest API">
```bash
curl -s --request POST \
    --url <DEPLOYMENT_URL>/runs/stream \
    --header 'Content-Type: application/json' \
    --header "X-Api-Key: <LANGSMITH API KEY> \
    --data "{
        \"assistant_id\": \"agent\", `# Name of agent. Defined in langgraph.json.`
        \"input\": {
            \"messages\": [
                {
                    \"role\": \"human\",
                    \"content\": \"What is LangGraph?\"
                }
            ]
        },
        \"stream_mode\": \"updates\"
    }"
```
</Tab>
</Tabs>

<Tip>
LangGraph Platform offers additional deployment options, including self-hosted and hybrid. For more information, please see [Deployment options](/langgraph-platform/deployment-options).
</Tip>
